import React from "react";
import './demo.less'
export default class children extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            count: 0,
        }
        this.handlAdd.bind(this)
    }
    componentWillMount() {
        //将会加载
        console.log('will mount')
    }
    shouldComponentUpdate() {
        //是否要更新数据
        console.log('should update?');
        return true
    }
    handlAdd() {

        this.setState({
            count: this.state.count + 1
        })
    }
    render() {
        return <div className = "ad" > 我是子组件 { this.props.name } <
            /div>
    }
}